// pinia 相比vuex只有三个属性
// 分别是state,actions,getters
// pinia 分模块不需要使用moudle 本身就是模块化开发
import {defineStore } from 'pinia'

 export const homeStore =defineStore({
  id:"myhome",
   state:()=>({
      myname:"刘德华",
      flag:true
   }),
   actions:{ //actions的写法
     changeName(name) { 
      console.log("123123"+name)
      this.myname=name;
    },
   },
   getters:{
      nameGet(){
        return this.myname+"明星"
      }
   }
})

export const countStore=defineStore({
  id:"mycount", 
  state:()=>{
    count:1
  },
  actions:{},
  getters:{}
})

